package com.qingcloud.adminbackend.entity.eid;

import cn.hutool.core.util.StrUtil;
import com.qingcloud.adminbackend.base.ElementPageParams;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * <p>
 * 设备编号批次分页查询
 * </p>
 *
 * @author wangjinnan
 * @since 2019-04-17
 */
@Data
public class EidBatchPageParam extends ElementPageParams {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "开始日期", example = "2019-04-10")
    private String startTime;

    @ApiModelProperty(value = "截止日期", example = "2019-04-23")
    private String endTime;

    @ApiModelProperty(value = "设备编号", example = "119")
    private String equipmentId;

    @ApiModelProperty(value = "批次ID列表", hidden = true)
    private List<String> batchIdList;

    @ApiModelProperty(value = "操作人", example = "ad")
    private String operator;

    @ApiModelProperty(value = "操作人ID列表", hidden = true)
    private List<String> userIdList;

    @ApiModelProperty(value = "产品类型编号 -1所有", example = "-1")
    private int product = -1;

    public String getEquipmentId() {
        if (StrUtil.isNotBlank(equipmentId)) {
            return "%" + equipmentId + "%";
        }
        return equipmentId;
    }

    public String getOperator() {
        if (StrUtil.isNotBlank(operator)) {
            return "%" + operator + "%";
        }
        return operator;
    }
}
